﻿using System;
using System.Data;
using System.Collections;
using CE.Database;

/// <summary>
/// Summary description for ChildInfoDB
/// </summary>
/// 
namespace CE.PersonalAccident
{
    public class ChildInfoDB
    {
        public ChildInfoDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Int64 Insert(ChildInfo childinfo)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "sprocPAProposalChildInsertUpdateSingleItem";

            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@PAChildId", childinfo.PAChildId);
            _sPara.Add("@PAProposalId", childinfo.PAProposalId);
            _sPara.Add("@PAId", childinfo.PAId);
            _sPara.Add("@PACompanyId", childinfo.PACompanyId);
            _sPara.Add("@Name", childinfo.Name);
            _sPara.Add("@DOB", childinfo.DOB);
            _sPara.Add("@Gender", childinfo.Gender);
            _sPara.Add("@NRICNo", childinfo.NRICNo);
            _sPara.Add("@Nationality", childinfo.Nationality);
            _sPara.Add("@Relation", childinfo.Relation);
            _sPara.Add("@RefCEUserId", childinfo.RefCEUserId);
            _sPara.Add("@ViewedDetailId", childinfo.ViewedDetailId);
            _sPara.Add("@Status", childinfo.Status);
            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }

    }
}